import { useState } from "react";

export default function useToggle(initialState: boolean):[boolean, (state:boolean)=>void]{
  const [state, setState] = useState<boolean>(initialState);

  function toggle(newState: boolean = !state){
    setState(newState);
  }

  return [state, toggle];
}
